package org.example.service.impl;

import org.example.domain.Grow;
import org.example.domain.GrowWorkCenter;
import org.example.mapper.GrowWorkCenterMapper;
import org.example.service.GrowWorkCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GrowWorkCenterServiceImpl implements GrowWorkCenterService {

    @Autowired
    GrowWorkCenterMapper growWorkCenterMapper;

    @Override
    public void addGrowWorkCenter(Grow grow) {
        if(null!=grow.getWids()&& grow.getWids().length>0){
            for (Integer wid : grow.getWids()) {

                GrowWorkCenter growWorkCenter = new GrowWorkCenter();
                growWorkCenter.setId(growWorkCenter.getId());
                growWorkCenter.setWorkId(wid);
                growWorkCenterMapper.addGrowWorkAdd(growWorkCenter);
            }
        }
    }
}
